package ia1011.zanzibar.chaos.AE;

import ia1011.zanzibar.chaos.parser.ChaosParser;

import ia1011.zanzibar.processor.RegExAggregator;

import java.io.File;
import java.util.Vector;

import org.apache.uima.analysis_component.JCasAnnotator_ImplBase;
import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
import org.apache.uima.jcas.JCas;
import org.apache.uima.resource.Parameter;
import org.apache.uima.resource.impl.Parameter_impl;

import chaos.alternatives.AvailableLanguage;
import chaos.alternatives.AvailableProcessor;
import chaos.processors.ProcessorException;

public class ChaosAnnotator extends JCasAnnotator_ImplBase{

	@Override
	public void process(JCas arg0) throws AnalysisEngineProcessException {
		// TODO Auto-generated method stub	
		try {
			Vector<AvailableProcessor> modules = new Vector<AvailableProcessor>();
			modules.add(AvailableProcessor.INN);
			modules.add(AvailableProcessor.TOK);
			modules.add(AvailableProcessor.MOA);
			modules.add(AvailableProcessor.POS);
			modules.add(AvailableProcessor.PMF);
			//modules.add(AvailableProcessor.TEM);
			//modules.add(AvailableProcessor.NER);
			//modules.add(AvailableProcessor.NES);		
			ChaosParser parser = new ChaosParser(modules, AvailableLanguage.it);
			String documentText = arg0.getDocumentText();			
			parser.parseNoChunker(arg0);
			/*String filePath = (String) getContext().getConfigParameterValue("ruleFile");			
			String indexName = (String) getContext().getConfigParameterValue("IndexName");
			RegExAggregator processor = new RegExAggregator(arg0, indexName);			
			//System.out.println(filePath);
			processor.initialize(filePath);
			arg0 = processor.run();*/
		} catch (ProcessorException e) {
			e.printStackTrace();
		}	
	}
}
